canvas .demo -width 1500 -height 900 -background white
button .end -text "done" -command exit

pack .demo .end -fill both -expand true



proc draw_state {originx originy scale text } {


	.demo create line $originx $originy [expr $originx+5*$scale] [expr $originy+5*$scale]
	.demo create line $originx [expr $originy + 5*$scale] [expr $originx+5*$scale] $originy

	.demo create line [expr $originx+5*$scale] $originy [expr $originx+20*$scale] $originy
	.demo create line [expr $originx+5*$scale] [expr $originy+5*$scale] [expr $originx+20*$scale] [expr $originy+5*$scale]


	.demo create text [expr $originx+5*$scale] [expr $originy+2.5*$scale] -anchor w -font {courier 10} -text "$text"

	
}

proc draw_states { originx originy scale text } {

	set step [expr 20*$scale]
	set numberofstep 0

	foreach i $text {
		draw_state [expr $step*$numberofstep+$originx] [expr $originy] $scale $i 
		set numberofstep [expr $numberofstep + 1]
	}
}

set scale 5
set lijn1 50

set alllines {{"DEQ1" "SH1" "SH2" "SH3" "SH4" "SH5" "SH6" "SH7" "SH8" "DEQ2" "NOP" "NOP" "NOP" "NOP" "NOP" "NOP" "NOP" "NOP"} {"" "" "C1" "C2"} {"D1" "D2" "D3"} {"ditiseentest" "jaj"}}

set lijnnummer 1
foreach i $alllines {
	draw_states 100 $lijn1*$lijnnummer  $scale $i
	set lijnnummer [expr $lijnnummer + 1]

}